import { createRequest } from '/@/api/service';
const module = 'ib/parking/v1/ParkCarApplyApi/';

/**
 * @function 车辆申请-列表查询
 * @param data
 * @param header
 * @returns {Promise}
 */
function APPLY_LIST_QUERY(
  data: ParkCarApplyApi.ApplyListQueryReq,
  header: object = {},
): Promise<ParkCarApplyApi.ApplyListQueryResp> {
  return createRequest(`${process.env.APP_API_URL}${module}queryApplyList`, data, header, 'POST');
}

/**
 * @function 车辆申请-新增申请
 * @param data
 * @param header
 * @returns {Promise}
 */
function ADD_CAR_APPLY(
  data: ParkCarApplyApi.AddCarApplyReq,
  header: object = {},
): Promise<ParkCarApplyApi.AddCarApplyResp> {
  return createRequest(`${process.env.APP_API_URL}${module}addCarApply`, data, header, 'POST');
}

/**
 * @function 车辆申请-审批
 * @param data
 * @param header
 * @returns {Promise}
 */
function APPROVE(
  data: ParkCarApplyApi.ApproveReq,
  header: object = {},
): Promise<ParkCarApplyApi.ApproveResp> {
  return createRequest(`${process.env.APP_API_URL}${module}approve`, data, header, 'POST');
}

export { APPLY_LIST_QUERY, ADD_CAR_APPLY, APPROVE };
